<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<title>学生选课</title>
	<!-- axios -->
	<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
	<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.min.js"></script>
	<!-- <link href="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.3/theme-chal" /> -->
	<!-- <script src=" https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.3/index.min"></script> -->
</head>

<body>
	<div id="app">
		{{user}}
	</div>
</body>
<script>
	new Vue({
		el: '#app',
		data: {
			user:''
		},
		created() {
			this.handleGet()
			this.handleInit()
		},
		methods: {
			handleInit() {
				let url = "http://localhost:3000/users/login"
				axios.post(url,{
					username: 'admin',
					password: 'admin'
				}).then(res => {
					console.log(res);
					this.user = res.data.data
				})
			},
			handleGet() {
				let url = "http://localhost:3000/users/findAll"
				axios.get(url).then(res => {
					console.log(res);
					this.user = res.data.data
				})
			}
		}
	})
</script>

</html>